package com.wc.blue_bridge_test.base.T48;

import java.io.PrintWriter;
import java.util.Scanner;

/**
 * @Author congege
 * @Description 特殊回文数
 * https://lx.lanqiao.cn/problem.page?gpid=T48
 * @Date Created in 2023/12/24-11:09
 */
public class Main {
    static PrintWriter out = new PrintWriter(System.out);

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        if (n == 1) {
            return;
        }
        // 5位数的回文
        for (int i = 1; i < 10; i++) {
            for (int j = 0; j < 10; j++) {
                int k = n - 2 * (i + j);
                if (k < 10 && k >= 0) {
                    out.print(i);
                    out.print(j);
                    out.print(k);
                    out.print(j);
                    out.print(i);
                    out.println();
                }
            }
        }

        // 打印回文
        for (int i = 1; i < 10; i++) {
            for (int j = 0; j < 10; j++) {
                for (int k = 0; k < 10; k++) {
                    if ((i + j + k) * 2 == n){
                        out.print(i);
                        out.print(j);
                        out.print(k);
                        out.print(k);
                        out.print(j);
                        out.print(i);
                        out.println();
                    }
                }
            }
        }


        out.flush();
    }
}
